﻿<%@ Page Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeFile="Topic.aspx.cs"
    Inherits="Manager_Topic_Topic" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%" cellpadding="2" cellspacing="0">
        <tr>
            <td align="left">
                <table style="border-collapse: collapse" bordercolor="#407db3" cellspacing="2" cellpadding="2"
                    width="100%" border="1" class="tbl_Comon-Search">
                    <tr>
                        <td class="td_Control" nowrap="nowrap" style="text-align: center; width: 89px;" align="center">
                            <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" CssClass="cssButton" OnClick="btnSearch_Click" /></td>
                        <td nowrap class="td_Title" style="width: 86px">
                            <asp:Label ID="Label2" runat="server" Text="Tên chủ đề" CssClass="lbl_Common-Search"></asp:Label></td>
                        <td align="left" class="td_Control">
                            <asp:TextBox ID="txtTenChuDe" runat="server" Width="90%"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" colspan="3" nowrap>
                            <input id="btnSort" class="cssButton" type="button" value="Sắp xếp thứ tự" onclick="openSeq()" />
                            &nbsp;<asp:Button ID="btnAdd_Catalogue" runat="server" Text="Thêm mới" CssClass="cssButton"
                                OnClick="btnAdd_Catalogue_Click" /></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="grv_Master" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" DataKeyNames="TopicID" Width="100%" CellPadding="2"
                    BorderColor="#407db3" OnRowCreated="grv_Master_RowCreated" OnRowDataBound="grv_Master_RowDataBound"
                    OnRowEditing="grv_Master_RowEditing" OnRowCancelingEdit="grv_Master_RowCancelingEdit"
                    OnRowUpdating="grv_Master_RowUpdating" OnRowDeleting="grv_Master_RowDeleting"
                    PageSize="20" OnPageIndexChanging="grv_Master_PageIndexChanging">
                    <Columns>
                        <asp:CommandField CancelImageUrl="~/Images/Icon/cmdCancel.gif" EditImageUrl="~/Images/Icon/cmdEdit.gif"
                            ShowEditButton="True" UpdateImageUrl="~/Images/Icon/Save.gif" ButtonType="Image">
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Wrap="False" />
                            <HeaderStyle CssClass="cssBorderGrv" />
                        </asp:CommandField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="lblDelete" runat="server" CommandName="delete" Text="<img src=../../Images/Icon/cmdDelete.gif border=0 alt=Delete > "></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" />
                            <HeaderStyle CssClass="cssBorderGrv" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Tên chủ đề
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("TopicName") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtETenTL" runat="server" Text='<%# Eval("TopicName") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left" Width="100%" />
                            <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Xem
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkViewChose" runat="server" Enabled="false" />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:CheckBox ID="chkEditChose" runat="server" />
                            </EditItemTemplate>
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left" Width="1%" />
                            <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Left" Wrap="False" />
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="gvRowStyle" />
                    <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
                    <HeaderStyle CssClass="gvHeader" />
                </asp:GridView>
            </td>
        </tr>
    </table>

    <input type="hidden" runat="server" id="hPccMsg" />

    <script language="javascript" type="text/javascript">
	        var windowSort;
            function openSeq()
			{
				var width =750
				var height =500
				

				var left = parseInt((screen.availWidth/2) - (width/2));
				var top = parseInt((screen.availHeight/2) - (height/2));
				var feature = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",screenX=" + left + ",screenY=" + top + ",menu=0,scrollbars=0,status=1,location=0";
				var CodeID='<%=Request.QueryString["CodeID"] %>';				
				if(!windowSort||windowSort.closed)
				{
					windowSort=window.open("SortTopic.aspx?CodeID="+CodeID,"newWin",feature);				
				}
				else
				{
					windowSort.focus();
				}
		
			}
			function fnOK()
			{
			       var form=document.forms["aspnetForm"];
			       var  hidMethod=document.getElementById("<%= hPccMsg.ClientID%>");
			       hidMethod.value="<Method>Refesh</Method>";
			       form.submit(); 
			}
    </script>

</asp:Content>
